package com.milkTeaServer.dao;

import com.milkTeaServer.bean.Comment;
import com.milkTeaServer.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentDao extends JpaRepository<Comment,Integer> {
    @Query(value="select id, userid, teaid,comment,date,score from t_comment where teaid = ?1 order by date desc",
            nativeQuery=true )
    List<Comment> findByMilkTeaId(Integer milkTeaId);
}
